home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 171 / 171.d81 / b.spiral slide (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  10KB  |  276 lines

  1. 10 poke56,56:clr:dv=peek(186):ifdv<8ordv>29thendv=8
  2. 12 poke788,49:tq=ti
  3. 14 poke53281,0:poke53280,0:print"[147]":gosub60000
  4. 20 sys57812"spiral font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
  5. 22 ifti<tq+100then22
  6. 30 poke53272,31
  7. 100 gosub 1000: rem initialize
  8. 110 gosub 2000: rem instructions
  9. 120 gosub 3000: rem conditions, board
  10. 130 on m goto 140,140,180,180
  11. 140 gosub 5000: rem player move
  12. 150 if jk=1 then 7200:rem stopped
  13. 160 jj=hh: gosub 8000: if em=0 then on w goto 7000,7100: rem game won/lost
  14. 170 y=5-y: on m goto 180,140,180,110
  15. 180 gosub 6000: rem computer move
  16. 190 if jk=1 then 7200: rem stopped
  17. 200 jj=hh: gosub 8000: if em=0 then on w goto 7000,7100: rem game won/lost
  18. 210 y=5-y: on m goto 140,110,140,180
  19. 1000 dimm%(38,2),a%(3),b%(3,5),s$(5),d$(1):rem   poke808,225:poke818,32
  20. 1010 poke53371,0:fori=1to38:readm%(i,0):readm%(i,1):next
  21. 1020 data10,13,10,15,12,15,14,15,14,13,14,11,14,9,14,7,12,7,10,7,8,7,6,7,6,9
  22. 1030 data6,11,6,13,6,15,6,17,6,19,8,19,10,19,12,19,14,19,16,19,18,19,18,17
  23. 1040 data18,15,18,13,18,11,18,9,18,7,18,5,18,3,16,3,14,3,12,3,10,3,8,3,6,3
  24. 1050 b$="            [157][157][157][157][157][157][157][157][157][157][157][157]":b1$=b$+b$+b$+b$+b$+b$+b$+b$+b$
  25. 1060 fori=0to5:reads$(i):next
  26. 1070 data"[195][207][205][208][213][212][197][210] 2","[208][204][193][217][197][210]    ","[208][204][193][217][197][210] 1  ","[208][204][193][217][197][210] 2  ","[195][207][205][208][213][212][197][210]  "
  27. 1080 data"[195][207][205][208][213][212][197][210] 1"
  28. 1090 m=1:w=1:sm=1:d$(0)="[167][170][157][157][181][175]":d$(1)="[171][178][157][157][174][163]":return
  29. 2000 poke53280,0:poke53281,0:printchr$(14);chr$(8);:rem by floyd r. kirk
  30. 2010 print"[147]";tab(12);"[158][188][172][157][157][177][187][157][157][165][180][145][208][201][210][193][204] [145][188][172][157][157][177][187][157][157][165][180][145][204][201][196][197][154]"
  31. 2020 print"  [217]ou determine the initial layout of"
  32. 2030 print"the board by placing several coins in a"
  33. 2040 print"series of boxes connected in a spiral,"
  34. 2050 print"one coin to a box. [193]fter the coins are"
  35. 2060 print"placed, you and the computer alternate"
  36. 2070 print"sliding any one coin toward the center,"
  37. 2080 print"up to but not on or past the next coin"
  38. 2090 print"or the center of the spiral. [212]he game"
  39. 2100 print"ends when no further moves are possible.";
  40. 2110 print"  [217]ou decide whether the one making the"
  41. 2120 print"last move wins or loses, who moves"
  42. 2130 print"first, and how many coins are set in"
  43. 2140 print"which boxes. [207]n your turn, move using"
  44. 2150 print"the left and right cursor keys, then"
  45. 2160 print"select a square; the immediate outside"
  46. 2170 print"coin will slide in to that square."
  47. 2180 print"  [195]an't beat the computer? [212]hen switch"
  48. 2190 print"sides, play against another person, or"
  49. 2200 print"watch the computer play itself."
  50. 2210 print"             [159][208]ress a key";:poke198,0
  51. 2220 geta$:ifa$=""then2220
  52. 2230 return
  53. 3000 poke53280,12:poke53281,12
  54. 3005 print"[147]";tab(12);"[158][188][172][157][157][177][187][157][157][165][180][145][208][201][210][193][204] [145][188][172][157][157][177][187][157][157][165][180][145][204][201][196][197]"
  55. 3010 print"  [205]oves 1st vs. [205]oves 2nd"
  56. 3012 print" [144][185][185][185][185][185][185][185][185][185][185][185][185]  [185][185][185][185][185][185][185][185][185][185][185][185]  f1 [195]hange"
  57. 3015 print"[144][161]            [162][161]            [162]    players.";
  58. 3017 print" [144][182][182][182][182][182][182][182][182][182][182][182][182]  [182][182][182][182][182][182][182][182][182][182][182][182]"
  59. 3020 print"[196]oes the one who makes":print"the last move win or":print"lose?"
  60. 3022 printtab(7);"[144][185][185][185][185][185][185]";tab(29);"f3 [195]hange"
  61. 3025 printtab(6);"[144][161]      [162]";tab(32);"last"
  62. 3027 printtab(7);"[144][182][182][182][182][182][182]";tab(32);"move."
  63. 3030 print"[215]ho puts the coins":print"on the board?"
  64. 3032 print"    [144][185][185][185][185][185][185][185][185][185][185]";tab(29);"f5 [195]hange"
  65. 3035 print"   [144][161]"tab(14);"[162]";tab(32);"coin"
  66. 3037 print"    [144][182][182][182][182][182][182][182][182][182][182]";tab(32);"layer."
  67. 3040 printtab(29);"f7 [196]one."
  68. 3050 y=m-(m>2):r=6:c=2:gosub9000:prints$(y);""s$(5-y)
  69. 3060 r=12:c=8:gosub9000:ifw=1thenprint"[215][201][206] ":goto3070
  70. 3065 print"[204][207][211][197]"
  71. 3070 r=17:c=5:gosub9000:printleft$(s$(sm),8):poke198,0
  72. 3080 geta$:ifa$=""then3080
  73. 3090 ifa$="[135]"thensm=5-sm:goto3070
  74. 3095 ifa$="[134]"thenw=3-w:goto3060
  75. 3100 ifa$="[136]"then3120
  76. 3105 ifa$<>"[133]"then3080
  77. 3110 m=m+1:ifm=5thenm=1
  78. 3115 goto3050
  79. 3120 gosub4000:ifsm=4then3500
  80. 3121 r=5:c=27:gosub9000:print"3 coins.":printtab(27);"[208]ress [176] or [191]"
  81. 3123 printtab(27);"to move":printtab(27);"white box."
  82. 3124 printtab(27);"f7 [208]ick up":printtab(30);"or drop":printtab(30);"a coin."
  83. 3126 printtab(27);"f1 [196]one."
  84. 3128 print"";tab(27);:ifm=1thenprint"[217]ou have":goto3130
  85. 3129 print"[195]omputer has"
  86. 3130 printtab(27);"first move.":printtab(27);"[204]ast move":printtab(27);
  87. 3132 ifw=1thenprint"wins.":goto3135
  88. 3133 print"loses."
  89. 3135 cn=3:i=1:r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));""
  90. 3140 ch$="[157][136][133]":poke198,0
  91. 3150 geta$:ifa$=""thengosub9100:goto3150
  92. 3160 jl=0:forj=1to4:ifa$=mid$(ch$,j,1)thenjl=j:j=4
  93. 3170 next:ifjl=0then3150
  94. 3180 onjlgoto3200,3250,3300,3350
  95. 3200 il=i:i=i-1:ifi=0theni=38
  96. 3210 r=m%(il,0):c=m%(il,1):gosub9000:print"";d$(m%(il,2))
  97. 3220 r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));"":goto3150
  98. 3250 il=i:i=i+1:ifi=39theni=1
  99. 3260 goto3210
  100. 3300 ifcn<1andm%(i,2)=0then3150
  101. 3310 m%(i,2)=1-m%(i,2):ifm%(i,2)=0thencn=cn+1:goto3330
  102. 3320 cn=cn-1
  103. 3330 print"";tab(26);cn;"coin  [157][157]";:ifcn<>1thenprint"s";
  104. 3340 print".":r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));"":goto3150
  105. 3350 r=5:c=27:gosub9000:printb1$;"[145]";b1$
  106. 3355 r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2))
  107. 3360 hh=0:jj=38:gosub8000:ifem>0thenpoke53280,0:poke53281,0:return
  108. 3370 r=7:c=27:gosub9000:print"[212]oo simple!"
  109. 3380 printtab(27);"[212]ry again.":poke198,0
  110. 3390 forj=1to38:m%(j,2)=0:next:poke53370,0
  111. 3400 forj=1to500:geta$:ifa$<>""thenj=500
  112. 3410 next:poke53371,0:goto3120
  113. 3500 i=int(rnd(0)*2)+2
  114. 3510 j=int(rnd(0)*37)+2:ifm%(j,2)=1then3510
  115. 3520 r=m%(j,0):c=m%(j,1):gosub9000:print"";d$(1):m%(j,2)=1:i=i-1:ifi>0then3510
  116. 3530 r=22:c=27:gosub9000:print"[204]ast move":printtab(27);
  117. 3540 ifw=1thenprint"wins.":goto3360
  118. 3550 print"loses."
  119. 3560 goto3360
  120. 4000 print"[147]"tab(30)"[158][188][172][208][201][210][193][204]"
  121. 4010 printtab(16)"[198]loyd [203]irk's  [158][177][187]"
  122. 4020 printtab(30)"[158][165][180][204][201][196][197]":print:print
  123. 4030 print"   [167][170]  [167][170][167][170][167][170][167][170][167][170][167][170][167][170]"
  124. 4040 print"   [181][175]  [181][175][181][175][181][175][181][175][181][175][181][175][181][175]"
  125. 4050 print"   [167][170]  [167][170]          [167][170]"
  126. 4060 print"   [181][175]  [181][175]          [181][175]"
  127. 4070 print"   [167][170]  [167][170]  [158][184][184][167][170][167][170]  [167][170]"
  128. 4080 print"   [181][175]  [181][175]  [158][184][184][181][175][181][175]  [181][175]"
  129. 4090 print"   [167][170]  [167][170]      [167][170]  [167][170]"
  130. 4100 print"   [181][175]  [181][175]      [181][175]  [181][175]"
  131. 4110 print"   [167][170]  [167][170][167][170][167][170][167][170][167][170]  [167][170]"
  132. 4120 print"   [181][175]  [181][175][181][175][181][175][181][175][181][175]  [181][175]"
  133. 4130 print"   [167][170]              [167][170]"
  134. 4140 print"   [181][175]              [181][175]"
  135. 4150 print"   [167][170][167][170][167][170][167][170][167][170][167][170][167][170][167][170][167][170]"
  136. 4160 print"   [181][175][181][175][181][175][181][175][181][175][181][175][181][175][181][175][181][175]"
  137. 4170 return
  138. 5000 r=5:c=27:gosub9000:print"";s$(y);"":i=1:jk=0
  139. 5002 ifm%(i,2)=1theni=i+1:goto5002
  140. 5005 print:printtab(27);:ifem=1thenprintb$:goto5020
  141. 5010 print"[154][208]ress [176][154] or [191][154]":printtab(27);"to move":printtab(27);"white box."
  142. 5020 r=11:c=27:gosub9000:print"f7[154] [211]elect":printtab(30);"square."
  143. 5022 ifm=1orm=3thenprint:printtab(27);"f2[154]